import * as tsconfigPaths from 'tsconfig-paths'
import * as dotenv from 'dotenv'

tsconfigPaths.register()
dotenv.config()

import express, { Application } from 'express'
import http from 'http'
import { routes } from './routes'

const PORT = parseInt(process.env.PORT || '8000')

const app: Application = express()
const server = http.createServer(app)

app.use(express.json())
app.use(routes)

server.listen(PORT, () => {
    console.log(`Server running on port ${PORT}`);
})